Index

api/v1/jobs/{jobno}/stock

Path: api/v1/jobs/{jobno}/stock

This API is JSON:API compliant.

This endpoint supports the following methods:
GET POST PATCH DELETE

The resource type for this endpoint is JobStock
The identifier is jobno-lineid

The JobStock resource type attributes are as follows:

{
The quantity ordered. Notes
Updating the Qty does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added.
Updating the quantity ordered has no impact on qantity supplied or backorder quantity.
When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request

"qty":number
The quantity supplied. Notes
Updating the Qty Supplied does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added.
Updating the quantity supplied has no impact on qantity ordered or backorder quantity.
When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request

"suppliedQty":number
The quantity supplied. Notes
Updating the Qty Backorder does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added.
Updating the quantity backorder has no impact on qantity ordered or quantity supplied.
When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request

"backorderQty":number
The unit price. If Job is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPrice":number
The unit price exlusive of tax. Note that if Job is calculating prices from tax paid amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPriceTF":number
The unit price inclusive of tax. Note that if Job is calculating prices from tax exclusive amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPriceTP":number
The stock location code.
"locationCode":string (read-only)
Stock attribute configuration number.
optional
"configNo":integer (read-only) Note: Will not be returned in the response if value is null.
"serials": [{
A stock serial number.
"serialNo":string
Only applicable to stock that is serial and attributed on purchase or serial on sell.
optional
"stockAttrs": [{
The attribute name.
"name":string
The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats.
eg integer attributes values must be a whole number
date attribute values must be a date is ISO format
real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false").

"value":string
}]
}]
"stockAttrs": [{
The attribute name.
"name":string
The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats.
eg integer attributes values must be a whole number
date attribute values must be a date is ISO format
real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false").

"value":string
}]
"addinit":string (read-only)
optional
"adddate":string (DateTime in ISO format) (read-only)
"stockId":integer (read-only)
The Jim2 stock code
"stockCode":string (read-only)
"unit":string (read-only)
The stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock.
optional
"description":string
"modifyinit":string (read-only)
"modifydate":string (DateTime in ISO format) (read-only)
}

Example GET (Return all)

Path: api/v1/jobs/10/stock

Response:

{
    "data": [
        {
            "id": "10-1",
            "type": "JobStock",
          "attributes": {
            "qty": 1.0,
            "suppliedQty": 0.0,
            "backorderQty": 1.0,
            "unitPrice": 0.0,
            "unitPriceTF": 0.0,
            "unitPriceTP": 0.0,
            "locationCode": "NSW",
            "stockAttrs": [
              {
                "name": "Colour",
                "value": "R,Red"
              },
              {
                "name": "Size",
                "value": "8,Eight"
              }
            ],
            "addinit": "SYS",
            "adddate": "2024-06-24T14:04:00",
            "stockId": 7,
            "stockCode": "MULTILEVEL.MANF",
            "unit": "EACH",
            "description": "Multilevel Manufacture",
            "modifyinit": "SYS",
            "modifydate": "2024-06-24T14:04:19"
          },
            "relationships": {
                "stock": {
                    "data": {
                        "type": "Stock",
                        "id": "7"
                    }
                }
            }
        },
        {
            "id": "10-2",
            "type": "JobStock",
          "attributes": {
            "qty": 1.0,
            "suppliedQty": 1.0,
            "backorderQty": 0.0,
            "unitPrice": 0.0,
            "unitPriceTF": 0.0,
            "unitPriceTP": 0.0,
            "locationCode": "NSW",
            "serials": [
              {
                "serialNo": "serial1"
              }
            ],
            "addinit": "SYS",
            "adddate": "2024-08-23T11:43:00",
            "stockId": 1,
            "stockCode": "SAMSUNG.MON.27",
            "unit": "EACH",
            "description": "27\" QLED Samsung Monitor",
            "modifyinit": "SYS",
            "modifydate": "2024-08-23T11:43:50"
          },
            "relationships": {
                "stock": {
                    "data": {
                        "type": "Stock",
                        "id": "1"
                    }
                }
            }
        },
        {
            "id": "10-3",
            "type": "JobStock",
          "attributes": {
            "qty": 1.0,
            "suppliedQty": 1.0,
            "backorderQty": 0.0,
            "unitPrice": 0.0,
            "unitPriceTF": 0.0,
            "unitPriceTP": 0.0,
            "locationCode": "NSW",
            "serials": [
              {
                "serialNo": "serial1",
                "stockAttrs": [
                  {
                    "name": "Colour",
                    "value": "R,Red"
                  },
                  {
                    "name": "Size",
                    "value": "27,TwentySeven"
                  }
                ]
              }
            ],
            "addinit": "SYS",
            "adddate": "2024-08-23T12:24:00",
            "stockId": 2,
            "stockCode": "SAMSUNG.MON.27",
            "unit": "EACH",
            "description": "27\"Red QLED Samsung Monitor",
            "modifyinit": "SYS",
            "modifydate": "2024-08-23T12:24:49"
          },
            "relationships": {
                "stock": {
                    "data": {
                        "type": "Stock",
                        "id": "1"
                    }
                }
            }
        }
    ]
}

Example GET (Return specific)

Path: api/v1/jobs/10/stock/10-1

Response:

{
    "data": {
        "id": "10-1",
        "type": "JobStock",
        "attributes": {
            "qty": 1.0,
            "suppliedQty": 0.0,
            "backorderQty": 1.0,
            "unitPrice": 0.0,
            "unitPriceTF": 0.0,
            "unitPriceTP": 0.0,
            "locationCode": "NSW",
            "configNo": null,
            "addinit": "SYS",
            "adddate": "2024-06-24T14:04:00",
            "stockId": 7,
            "stockCode": "MULTILEVEL.MANF",
            "unit": "EACH",
            "description": "Multilevel Manufacture",
            "modifyinit": "SYS",
            "modifydate": "2024-06-24T14:04:19"
        },
        "relationships": {
            "stock": {
                "data": {
                    "type": "Stock",
                    "id": "7"
                }
            }
        },
      "links": {
        "self": "/api/v1/jobs/10/stock/10-1"
      }
    }
}

Example POST

Path: api/v1/jobs/10/stock

Request:

{
    "data" : 
    {
        "type": "JobStock",
      "attributes": {
        "stockCode": "MOUSE",
        "qty": 2.0,
        "serials": [
          {
            "serialNo": "serial1"
          },
          {
            "serialNo": "serial2"
          }
        ]
      }
    }    
}

Response:

{
    "data": {
        "id": "10-4",
        "type": "JobStock",
      "attributes": {
        "qty": 2.0,
        "suppliedQty": 2.0,
        "backorderQty": 0.0,
        "unitPrice": 0.0,
        "unitPriceTF": 0.0,
        "unitPriceTP": 0.0,
        "locationCode": "ACT",
        "serials": [
          {
            "serialNo": "serial1"
          },
          {
            "serialNo": "serial2"
          }
        ],
        "addinit": "API",
        "adddate": "2025-03-25T18:28:28.899892+11:00",
        "stockId": 5,
        "stockCode": "MOUSE",
        "unit": "EACH",
        "description": "Mouse",
        "modifyinit": "API",
        "modifydate": "2025-03-25T18:28:28.899892+11:00"
      },
        "relationships": {
            "stock": {
                "data": {
                    "type": "Stock",
                    "id": "5"
                }
            }
        },
      "links": {
        "self": "/api/v1/jobs/10/stock/10-4"
      }
    }
}

Example PATCH

Path: api/v1/jobs/10/stock/10-1

Request:

{
    "data" : 
    {
        "id" : "10-1",
        "type": "JobStock",
      "attributes": {
        "qty": 2.0,
        "stockAttrs": [
          {
            "name": "Colour",
            "value": "R,Red"
          },
          {
            "name": "Size",
            "value": "27,TwentySeven"
          }
        ]
      }
    }    
}

Response:

{
    "data": {
        "id": "10-1",
        "type": "JobStock",
      "attributes": {
        "qty": 2.0,
        "suppliedQty": 2.0,
        "backorderQty": 0.0,
        "unitPrice": 0.0,
        "unitPriceTF": 0.0,
        "unitPriceTP": 0.0,
        "locationCode": "NSW",
        "stockAttrs": [
          {
            "name": "Colour",
            "value": "R,Red"
          },
          {
            "name": "Size",
            "value": "27,TwentySeven"
          }
        ],
        "addinit": "SYS",
        "adddate": "2024-08-23T11:43:00",
        "stockId": 1,
        "stockCode": "SAMSUNG.MON.27",
        "unit": "EACH",
        "description": "27\" QLED Samsung Monitor",
        "modifyinit": "API",
        "modifydate": "2025-03-25T18:26:16.8189395+11:00"
      },
        "relationships": {
            "stock": {
                "data": {
                    "type": "Stock",
                    "id": "1"
                }
            }
        },
      "links": {
        "self": "/api/v1/jobs/10/stock/10-1"
      }
    }
}